home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
ms_dos
/
tool
/
fapxtool
/
src
/
txl
/
txl.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-12
|
12KB
|
369 lines
/**************** txl.h *******************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <jctype.h>
#include <jstring.h>
#include <dos.h>
#include <io.h>
#include <fcntl.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <conio.h>
#include <time.h>
#ifdef LSI_C
#include <farstr.h>
#else
#include <malloc.h>
#endif
#define NUL '\0'
#define TAB 0x09
#define RET 0x0A
#define CR 0x0D
#define LF 0x0A
#define TRUE 1
#define FALSE 0
#define MAX_STR 9
#define KFL_MAX 160
#define KQ__MAX 80
#define NP_DEL 4
#define OP_MAX 16 /* 引数の最大数 */
/**** use in txfdir.h ***********/
struct find_t_s {
char attrib;
unsigned wr_time;
unsigned wr_date;
long size;
char name[13];
};
struct _foruminfo {
int key; /* キーコード */
int next; /* 次の項目の配列番号 */
char fname[15]; /* フォーラムネーム(半角大文字) */
char title[41]; /* フォーラムの題名 */
};
typedef struct priority {
char *str; /* 表示文字列 */
char *name; /* 比較文字列 */
int cmp; /* 比較文字数 */
int pri; /* 優先順位(下位0-7ビット) */
/* ↑ビット8はフォーラムフラグ */
} PRIORITY;
/********************************/
#ifdef MAIN
FILE *fpmes;
char *inputfile;
char *outputfile;
char *line1, *line2, *line3;
char *cfwork;
char *cfptr[OP_MAX];
long int totalret=0; /* used by LCX */
long int totalretx=0; /* used by LCX */
long int totalsize=0; /* used by LCX */
int sortoption = 0;
int dirinfo = 0;
int castname = 0;
int dspfile = 0;
int recursivedir = 0;
int dspforumname = 0;
int maxfcbs;
int maxfinfo;
int maxfinfodata;
int maxexclude = 0;
struct _foruminfo far *finfo;
char *txfsetfile = "FAPXTXL.SET";
char sfstr[MAX_STR][48]={
"*:お知らせ *:掲示板 *:電子会議",
"FORUM:",">GO ",
"- LIB ","LIB:",
"ID (改行のみ:自分のHP)\r\n:",
"HP:",
"ID (改行のみ:自分のパティオ)\r\n:",
"PATIO:"
};
char *pfstr[MAX_STR] = {
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
/* 0 1 2 3 4 5*/
/* 0123456789012345678901234567890123456789012345678901234567890 */
char logstr_mes1[30] ="%% %%%%% ( %%%) %%/%% ";
char logstr_mes2[15] ="- ^4MES(%%):";
char logstr_mes3[41] ="%%%/%%% ***%%%%% $$$$$$$$$$$$$$$$ ";
char logstr_mes4[42] ="%%%%%/%%%%% ***%%%%% $$$$$$$$$$$$$$$$ ";
char logstr_dlib[42] ="%%%%$ ***%%%%% %%/%%/%% %%%%%%% %%%% * ";
char logstr_qlib[38] ="%%%%$ ***%%%%% %%/%%/%% %%%%%%% * ";
char logstr_wftowns[6] =" #%";
char logstr_hp[40] ="%%% [%%/%%/%% %%:%%] ***%%%%% ";
char logstr_mail[44] ="%% $$$$$$$$$$$$$$$$$ ***%%%%% %%/%% %%:%%";
char logstr_mail2[56] ="%% $$$$$$$$$$$$$$$$$ ***%%%%% %%/%%/%% %%:%%";
char logstr_pcvm[44] ="%% - PCV>***%%%%% %%/%% %%:%%";
char logstr_pcvm2[56] ="%% - PCV>***%%%%% %%/%%/%% %%:%%";
char logstr_wide[44] ="%% **** GATE ***%%%%% %%/%% %%:%%";
char logstr_wide2[56] ="%% **** GATE ***%%%%% %%/%%/%% %%:%%";
#if 0
char logstr_ffmtop[22] ="^1/%%[^1]^3(DL%%-%%%";
#endif
char logstr_fravtop[16]="%%/%% DL%% #%%%";
char logstr_ffsutop[72]="%%/%%$$$$$$$$$$$$$$$$$$$$.$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$ ***%%%%% ($%-";
char logstr_mlist[80] ="$%% $$$$$$$$$$$$$$$$$%%/%% $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&&&&&&&&";
char logstr_fgallib[39]="&& %% %%%% ***%%%%% %%/%%/%% %%%%%%% *";
/*
- FFMHOB MES(20):【交 流】自己紹介の場、『無節荘』第10館 92/05/13 -
- FTOWNS1 MES( 7):Gamer’s Q&A(2) 92/05/13 -
20 919 ( 5) 05/13 【交 流】自己紹介の場、『無節荘』第10館
005/005 XXX00000 ハンドル ストック会議室にも
( 3) 92/09/25 23:08
01453/01453 PFG02442 中谷 友彦 テスト♪てすと♪
( 2) 92/09/22 22:56
ID (改行のみ:自分のHP)
:PEE01244
パスワード
:
20 999 ( 0) 05/16 [交 流]自己紹介の場、『無節荘』第10館
250 PFG02442 92/04/05 25408 25 B TXF136E .EXE テキストファイル フォーマッタ Ver1.36e
12/12[TOWNS] ぼむぼむ (DL 5-433)
12/08[TOWNS] 背景画ランダムセレクター (DL 4-222)
08/31 Tue DL04 #349 ぴー 祝! FRAV
120 [92/05/16 21:14] PEE01244 CATLOG.EXP使ってみました<Yama-chan
09/22 [DOS汎] XTR150DF.LZH テキスト整形ツールXTR V1.50d/フルセット MHD00147 (#5- 32)
-------------------------------------------------------------------------------
6 - PCV>ZZZ99999 04/01 07:29
題名:PC-VANからのテストだよ~ん
PCVAN-Message-Id: #05121046
PCVAN-Date: 93/04/01 07:21:12
-------------------------------------------------------------------------------
1 - PCV>ZZZ00000 04/01 15:05
題名:HELLO
PCVAN-Message-Id: #05121811
PCVAN-Date: 93/04/01 12:45:16
-------------------------------------------------------------------------------
2 INET GATE WID00101 03/03 12:47
4 WIDE GATE WID00100 03/22 09:19
題名:MAIL from WIDE for FAPX
Date: Mon, 22 Mar 93 08:56:23 JST
From: naka@cms101.cmlab.densi.kansai-u.ac.jp
To: PEE01244@niftyserve.or.jp
Cc: PEA03123@niftyserve.or.jp
-------------------------------------------------------------------------------
番号 送信者 日付 題名 識別子
1 ********** 04/08 B NEWSARA.LZH 未だできんんんんんんん ILDFTINC
*/
long int log_tline=0;
char log_fname[16]="UNKNOWN";
char log_pname[16]="";
char log_idstr[16]=" ";
char log_libstr[4];
int log_libno;
int log_downno;
char log_downname[16]="";
char log_docfile[16]="";
char log_titlestr[48];
char log_resstr[16]="";
char log_resp[12]=" ";
char log_handle[20]=" ";
char log_rhandle[20]="";
int log_hpstyle = 0;
unsigned short log_hpchr = 0;
int log_mesno;
char log_reply[8];
char *log_bufptr;
char filechr[32]={0,0,0,0,0x5f,0x086,0x0ff,0x0c0,0x0ff,0x0ff,0x0ff,0x0e3,0x0ff,
0x0ff,0x0ff,0x0f6,0,0,0,0,0x03,0x0ff,0x0ff,0x0ff,0x0ff,
0x0ff,0x0ff,0x0ff,0,0,0,0};
char npcut_front[4] ={0x1b,0x26,0x36,0x41};
char npcut_tellstr[5]={0x1b,0x26,0x36,0x40,0};
char npcut_nifend[21]={ 0x18,0x1f,0x40,0x40,0x0e,0x20,0x7f,0x7f,0x21,0x4c,
0x3e,0x44,0x3c,0x40,0x40,0x40,0x40,0x20,0x68,0x40,0};
char npcut_niffirst[9]={0x1b,0x23,0x33,0x1b,0x33,0x1b,0x26,0x32,0};
char npcut_weather[10]={0x1b,0x2d,0x57,0x0e,0x21,0x4c,0x20,0x68,0x40,0};
int weatherflg = 0;
int make_val = 0 ;
#endif
extern FILE *fpmes;
extern char *inputfile;
extern char *outputfile;
extern char *line1, *line2, *line3;
extern char *cfwork;
extern char *cfptr[OP_MAX];
extern long int totalret; /* used by LCX */
extern long int totalretx; /* used by LCX */
extern long int totalsize; /* used by LCX */
extern int sortoption;
extern int dirinfo;
extern int castname;
extern int dspfile;
extern int recursivedir;
extern int dspforumname;
extern int maxfcbs;
extern int maxfinfo;
extern int maxfinfodata;
extern int maxexclude;
extern struct _foruminfo far *finfo;
extern char *txfsetfile;
extern char sfstr[MAX_STR][48];
extern char *pfstr[MAX_STR];
extern char *dlib_bufptr;
extern long int log_tline;
extern char log_fname[16];
extern char log_pname[16];
extern char log_idstr[16];
extern char log_libstr[4];
extern int log_libno;
extern int log_downno;
extern char log_downname[16];
extern char log_docfile[16];
extern char log_titlestr[48];
extern char log_resstr[16];
extern char log_resp[12];
extern char log_handle[20];
extern char log_rhandle[20];
extern int log_hpstyle;
extern unsigned short log_hpchr;
extern int log_mesno;
extern char log_reply[8];
extern char *log_bufptr;
extern char logstr_mes1[30];
extern char logstr_mes2[15];
extern char logstr_mes3[41];
extern char logstr_mes4[42];
extern char logstr_dlib[42];
extern char logstr_qlib[38];
extern char logstr_wftowns[6];
extern char logstr_hp[40];
extern char logstr_mail[44];
extern char logstr_mail2[56];
extern char logstr_pcvm[44];
extern char logstr_pcvm2[56];
extern char logstr_wide[44];
extern char logstr_wide2[56];
extern char logstr_ffmtop[22];
extern char logstr_fravtop[16];
extern char logstr_ffsutop[72];
extern char logstr_mlist[80];
extern char logstr_fgallib[39];
extern char filechr[32];
extern char npcut_front[4];
extern char npcut_tellstr[5];
extern char npcut_nifend[21];
extern char npcut_niffirst[9];
extern char npcut_weather[10];
extern int weatherflg;
extern int make_val;
/* external function */
int sort_date(struct find_t_s *x, struct find_t_s *y);
int sort_size(struct find_t_s *x, struct find_t_s *y);
int sort_name(struct find_t_s *x, struct find_t_s *y);
int sort_ext(struct find_t_s *x, struct find_t_s *y);
PRIORITY *howpri(struct find_t_s *z);
int sort_fapx(struct find_t_s *x, struct find_t_s *y);
char *castlow(char *str);
char *castlow1(char *str);
char *castlow2(char *str);
void idlog(char *fname, FILE *fp);
void catloglib(char *fname, FILE *fp);
void liblist(char *fname, FILE *fp);
void rtnmes(char *fname, FILE *fp);
void catlogmes(char *fname, FILE *fp);
void catlogmail(char *fname, FILE *fp);
void subdir(struct find_t_s *fcbs, FILE *fp, char *name, int base);
void dirmain(struct find_t_s *fcbs, FILE *fp, unsigned int attr, long *para);
void dir(int dirsort, int filesort);
void dirdriver(char *val[]);
int getkeyid(char *str);
void readmyforum(char *fpath);
void readtitle(char *fpath, long *para);
int dspmyforum(char *fname, FILE *fp);
char *get_filename(char *wildcard);
void lcx (char *lcxinputfile);
void lcxdriver(char *param[]);
void logfindstr(FILE *input);
void logs(void);
void loginit(void);
void logdriver(char *val[]);
int matchstr(char *form, char far *txtptr);
int linestyle(void);
void get_forum(int type);
void get_libno(int type);
void get_titlestr(void);
void del_tailspace(char *str, int len);
void meschk(int style);
char *setdataexp(char kind);
void get_downname(void);
void dlibchk(int style);
void get_forum_overrun(void);
void ffsutopchk(int style);
void ffmtopchk(int style);
void fravtopchk(void);
int get_hpstyle(char *id, int org);
void hpchk(void);
void mailchk(int style);
void widegatechk(void);
void maillistchk(void);
void fgalchk(void);
void errexit(char *errmes);
void init(char *name);
int main(int argc, char *argv[]);
void result(void);
void make_new_name(char *tellptr);
int findfront(FILE **input, FILE **output);
int findtell(int endflg, FILE **input, FILE **output);
void npcut(void);
void npcutinit(void);
void npcutdriver(char *val[]);
int chkoprnd(char next);
void swchk(int count, char *val[]);
void cfexpand(int count, char *val[]);
void expand_passwd(char *val[]);
void compress_passwd(char *val[]);
void dlldriver(char *val[]);
void rtndriver(char *val[]);
void bottomcut(char *val[]);
void bottomdsp(char *val[], int level);
void craftname(char *val[], int (*func)(char *name, FILE *fw));
int craftfb(char *forumname, FILE *fw);
int craftbf(char *basename, FILE *fw);
void settime(char *tmstr);
void setdate(char *dtstr);
#ifndef LSI_C
#define farfree(a) _ffree(a)
#define farmalloc(a) _fmalloc(a)
#define far_strcpy(a,b) _fstrcpy(a,b)
#define far_strncpy(a,b,c) _fstrncpy(a,b,c)
#define far_strcmp(a,b) _fstrcmp(a,b)
#define far_strncmp(a,b,c) _fstrncmp(a,b,c)
#endif
/* DLL 化対策 */
extern void Exit(int val);